package bTree.LeetCode;

public class 制造字母异位词的最小步骤数2 {
    public int minSteps(String s, String t) {
        int []array1=new int[26];
        int []array2=new int[26];
        int length1 = s.length();
        int length2 = t.length();
        for (int i = 0; i < length1; i++) {
            char c = s.charAt(i);
            int i1 = c - 97;
            array1[i1]++;
        }
        for (int i = 0; i < length2; i++) {
            char c = t.charAt(i);
            int i1 = c - 97;
            array2[i1]++;
        }
        int res=0;
        for (int i = 0; i < 26; i++) {
            res+=Math.abs(array1[i]-array2[i]);
        }
        return res;
    }
}